-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --remote
flag for remote connection
#10352
Conversation
🦋 Changeset detectedLatest commit: ff057e1 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
LGTM! Can you add to other commands as well?
If local
|
69865ea
to
511fb4e
Compare
build --remote
flag for remote connection--remote
flag for remote connection
export const RUNTIME_CONFIG_IMPORT = JSON.stringify(`${PACKAGE_NAME}/runtime/config`); | ||
|
||
export const DB_TYPES_FILE = 'db-types.d.ts'; | ||
|
||
export const VIRTUAL_MODULE_ID = 'astro:db'; | ||
|
||
export const DB_PATH = '.astro/content.db'; | ||
export const DB_PATH = `.astro/${ | ||
process.env.ASTRO_TEST_RANDOM_DB_ID ? randomUUID() : 'content.db' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this regenerated when some HMR change is triggered or when we restart the server? Is it fine if it is regenerated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be regenerated for our test runners! See comment on the basics test. In short, the test runner starts multiple dev servers in parallel if it finds this optimal (does not occur locally for some reason). If there's multiple servers pointing to the same db file, seed data will be clobbered. We also can't inject a db name as an environment variable because then the environment variable would get clobbered by each test run 😅 This is the best compromise I could find
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, if you're wondering if the ID is stable for the lifetime of the test, it seems to be. Can't think of an HMR trigger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you for the detailed explanation :) just making sure if that's what we need
@FredKSchott done! Added the |
71e8987
to
68b9bc6
Compare
68b9bc6
to
ff057e1
Compare
Changes
Require the
--remote
flag to dev or build with a studio connection. Use a local db with local seeding for standardastro build
call.--remote
check to dev and build--remote
support toshell
andexecute
author3
andauthor4
config in ticketing exampleTesting
Docs
https://docs-git-sarah-patch-6-astrodotbuild.vercel.app/en/guides/astro-db/#production-builds